package jbpm.example.workflow;

import com.google.inject.Inject;
import jbpm.example.preciouscode.Registration;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.node.DecisionHandler;


public class IsAGeekDecision implements DecisionHandler {

    private static final long serialVersionUID = -6545038205503445680L;
    private Registration register;

    @Inject
    public IsAGeekDecision(Registration inj) {
        this.register = inj;

    }

    public String decide(ExecutionContext executionContext) throws Exception {
        if (register.isAGeek(1)) {
            return "yes";
        } else {
            return "no";
        }
    }

}
